package cn.wsh.org.controller;

/**
 * @ClassName : TestController
 * Author : "吴----"
 * @date : 2022/2/8 20:52
 */

import cn.wsh.org.common.ResponseFactory;
import cn.wsh.org.common.Result;
import cn.wsh.org.domain.Employee;
import cn.wsh.org.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class TestController {

    @Autowired
    private IEmployeeService employeeService;

    @Autowired
    private IDepartmentService departmentService;

    @GetMapping("list")//emp 表格全部
    public Result listemp() {
        return ResponseFactory.build(employeeService.queryAll());
    }

    @GetMapping("list1")//dept表格全部
    public Result listDept1() {
        return ResponseFactory.build(departmentService.queryAll());
    }
    @GetMapping("list2")//dept 分页查询
    public Result listDept2() {
        return ResponseFactory.build(departmentService.queryTree());
    }
    @GetMapping("list3")
    public Result listDept3() {
        return ResponseFactory.build(departmentService.hashCode());
    }

}
